#include <iostream>
#include <assert.h>
#include <cstdlib>
#include "../utils/message.h"
#include "../balancer/submission.h"

using namespace std;

int main(int argc , char** argv) {
	assert(argc == 4);
	
	int channelId = atoi(argv[2]);
	int messageType = atoi(argv[3]);
	
	MessageChannel channel(channelId);
	SubmissionMessage *message = new SubmissionMessage(messageType);
	
	//for (int i = 0 ; i < 20 ; i++) {
	message->setSubmissionId(argv[1]/* + i*/);
	
	cout << message->getSubmissionId() << endl;
	
	channel.send(message);
		
	cout << "OK" << endl;
	//}
	
	delete message;
	
	
	
	return 0;
}
